package com.clear.honghefinance.biz.modules.system.member.domain.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * <p>
 * 获取用户短信验证码DTO
 * </p>
 */
@Getter
@Setter
public class GetUserSmsCodeDTO implements Serializable {

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式有误")
    private String phone;

    /**
     * 图形验证码
     */
    @ApiModelProperty(value = "图形验证码")
    @NotBlank(message = "请输入图形验证码")
    @Pattern(regexp = "^[a-zA-Z0-9]{5}$", message = "图形验证码格式不正确")
    // todo 可联动redis查询图形验证码是否正确
    private String code;

    /**
     * 短信验证码类型
     */
    @ApiModelProperty(value = "验证码类型 UPDATE_PHONE")
    @NotBlank(message = "短信验证码类型不能为空")
    @Pattern(regexp = "^UPDATE_PHONE$", message = "短信验证码类型非法")
    private String smsCodeType;

}